<template>
  <div class="tab" >
      <div class="tab-title flex fz-18" >
            <div class="tab-item" v-for="(item,index) in tabList" :key="item.id" @click="chang(index)" :class="item.isActive? 'active':''">
                {{item.value}}
            </div>
      </div>
        <div class="tab-content">
            <slot></slot>
        </div>

  </div>
</template>

<script>

export default {
    props: ['tabList'],
    data(){
        return {

        }
    },
    methods: {
        chang(index) {
            this.$emit('changTab',index);
        }
    }
}
</script>

<style lang="less" scoped>
    .tab-item {
        margin-left: 30px;
        line-height: 31px;
    }
    .tab-content {
        padding: 10px;
    }
    .active {
        font-size: 22px;
        border-bottom: 2px solid #797979;
    }
</style>